home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2003-06-24 | 40.0 KB | 1,071 lines
<html> <head> <title>ServerWatch Display</title> <link rel="stylesheet" type="text/css" href="css/rpmstyle.css"> <style> .EventLog { border-style : solid; border-width : 3px; overflow : scroll; background-color:white } .EventLog { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white} .VAMainBox { border: none; background-color : activeborder } .PopUpBox { margin:0; padding:0; overflow : scroll; width : 95% } .PopUpBox { border-style : solid; border-width : 2px; overflow : scroll; background-color:white } .PopUpBox { border-top-color : #555555; border-left-color : #555555; border-bottom-color : #E0E0E0; border-right-color : #E0E0E0 } .PopUpSSBox { background-color:activeborder; position:absolute; margin:0; padding:0; border : solid thin; } .PopUpSSBox { border-top-color : #E0E0E0; border-left-color : #E0E0E0; border-bottom-color : #555555; border-right-color : #555555 } </style> </head> <body class="bodyc" scroll="no" style="margin:3px; overflow: none"language="JavaScript" RPMHostIP="!BreakoutBot:MonitorIP!" RPMHostPort="!BreakoutBot:MonitorPort!" onclick="checkClick()" RPMUserName="!BreakoutBot:UserName!" BOBDone="!BreakoutBot:Done!" onload="top.banner.savePageCoord(event,document.body,'ServerWatch'); InitRpmCC_VA();" onbeforeunload="DiscoRpmCC_VA()" onresize="processSizeChange()" onkeydown="processBSP()"> <script LANGUAGE="JavaScript"> <!-- var bdH = 0; var byM = null; var borderSz = 2; // Thin Bord is 2pixels var STid = null; // Timeout ID var Tid = null, CTid= null, LTid = null, ETid = null; var StopFlag = false; // abort Discovery process var ELogWinInit = ""; // save for ElogWin init HTML var ELBgFlg = 0; // Log Background color toggle var PuPW = "500px", PuPWu=500, PuPH = "250px",PuPHu=250; var PopUH = 0; var PopUL = 0; var TitleTop = ButtonTop = 0; var TitleLeft = ButtonLeft = 0; var SpecificationsMade = false; var ValidateFilter = true; // Validate Filter on entry var Hp = null; // Host port var ReconnectEvent = false; var GetMRU = true; var AC_CompStoreArr = new Array(); var AC_ServicesStoreArr = new Array(); var AC_FilterStoreArr = new Array(); var AL_AlertStoreArr = new Array(); // Capture and ignore script errors window.onerror = wwScrErr; function wwScrErr() { return true; } /* On Load tell the Comm control to Connect to the Server */ function InitRpmCC_VA() { top.MainLoaded = true; // Flag that Main is now loaded top.banner.savePageCoord(event,document.body,"ServerWatch"); byM = 2*parseFloat(document.body.style.margin); processSizeChange(); // Initialize Graph Scale Drop Down for ( var i=1; i<=19; i++ ) { addElementToSelect(SS_Scale,(i*50)+" ms. "); } for ( var i=1; i<=20; i++ ) { addElementToSelect(SS_Scale,(i)+" secs. "); } /* Connect to Server */ Hp = parseInt(document.body.RPMHostPort,10); RpmCC_VA.Connect(document.body.RPMHostIP,Hp, ""); /* get Track Last checkbox state */ cc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"TrackLast"); // get state if ( cc == "unchecked" ) { // If not checked TrackLastEnabled.checked = ""; } else { TrackLastEnabled.checked == "CHECKED"; } /* get ServiceDownAtTop checkbox state */ cc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"ServiceDownAtTop"); // get state if ( cc == "unchecked" ) { // If not checked ServiceDownAtTop.checked = ""; } else { ServiceDownAtTop.checked == "CHECKED"; } } function processReconnect() { Tid = null; if ( RpmCC_VA.IsConnected() ) { Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection return; } RpmCC_VA.Connect(document.body.RPMHostIP,Hp, ""); } function processConnectConfirmed() { // Restore Filter and Computer Store if ( ReconnectEvent == false ) { var fs = RpmCC_VA.RegGetKey(top.banner.ServerID+"ServerWatchFilterArray"); AC_FilterStoreArr.length = 0; if ( fs != "" ) { AC_FilterStoreArr = fs.split("~"); } // Get saved sort code fs = RpmCC_VA.RegGetKey(top.banner.ServerID+"ServerWatchSortCode"); LogSortCode = ( fs != "") ? parseInt(fs,10) : 7; // Get saved Response Time Graph Scale Max fs = RpmCC_VA.RegGetKey(top.banner.ServerID+"ServerWatchScaleMax"); RespMax = ( fs != "") ? parseInt(fs,10) : 500; GetMRU = true; processLogWindow(); // initialize Log Window processAlLookup(); //initiate read for Alert Groups and Services if ( top.QuickStartProcessing ) { showHelp('Help/QuickStart_Help.htm#ServerWatch'); window.focus(); top.QuickStartProcessing = false; } ReconnectEvent = true; } else { //RpmCC_VA.GetServicesLogMRU(); // get most recent Server log ServerWatch messages RpmCC_VA.AllowNewMessages(); // enable new Server Log messages to be sent } top.Rstatus.Pstat("Connected"); if ( Tid != null ) { clearTimeout(Tid); // stop timeout routine } Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection } function processConnectionCheck() { Tid = null; RpmCC_VA.SendKeepAlive("Check"); Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection } function processTrackLastClick() { // Save Track Last checkbox state cc = ( TrackLastEnabled.checked == false ) ? "unchecked" : "checked"; top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"TrackLast",cc); // set state } function processServiceDownAtTopClick() { // Save Failure At Top checkbox state cc = ( ServiceDownAtTop.checked == false ) ? "unchecked" : "checked"; top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"ServiceDownAtTop",cc); // set state GoDoSort(); // go do it } // Process Database Change event function processDBChanged() { CTid = null; top.banner.processStartComm(); // Insure Specify pop-up is hidden and disabled //SpecifyButton.className = "BoxButtonD"; // disable button SpecifyButton.disabled = "disabled"; // disable button PopUpDiv.style.display = "none"; // Clear Stores AL_AlertStoreArr.length = 0; AC_ServicesStoreArr.length = 0; GetMRU = false; ValidateFilter = true; processAlLookup(); //initiate read for Alert Groups and Services top.Rstatus.StatDB.style.display = "none"; Tid = setTimeout("finishDBChange()",1000); // Delay } /* Get MRU Log Messages for ServerWatch */ function finishDBChange() { Tid = null; // reset //SpecifyButton.className = "BoxButton"; // enable button SpecifyButton.disabled = ""; // enable button top.banner.processStopCommX(); } /* On Unload tell the Comm control to Disconnect from the Server */ function DiscoRpmCC_VA() { top.BannerMenuShow(); RpmCC_VA.Disconnect(); top.banner.processStopCommX(); if ( STid != null ) { clearTimeout(STid); // stop timeout routine } if ( Tid != null ) { clearTimeout(Tid); // stop timeout routine } if ( LTid != null ) { clearTimeout(LTid); // stop timeout routine } if ( ETid != null ) { clearTimeout(ETid); // stop timeout routine } } var SCbsy = false; function processSizeChange() { if ( SCbsy ) return; SCbsy = true; // Display Height and Width bCh = document.body.clientHeight; bCw = document.body.clientWidth; // Minimums bCh = (bCh < bdH+byM+PuPHu+20) ? bdH+byM+PuPHu+20 : bCh; bCw = (bCw < PuPWu+10) ? PuPWu+10 : bCw; document.body.scroll = (bCw <= PuPWu+10 || bCh <= bdH+byM+PuPHu+20) ? "yes" : "no"; // Set Height/Widths for Main window area VA_MainBox.style.height = bCh-(bdH+byM-borderSz)-10; VA_MainBox.style.width = bCw-byM-4; VA_MainBox.style.display = ""; // PopUp PopUpDiv.style.left = PopUL = (bCw-PuPWu)/2; PopUpDiv.style.top = "20px"; PopUpDiv.style.height = PopUH = bCh-(bdH+byM-borderSz)-35; PopUpDiv.style.width = PuPW; PopUpSS.style.left = PopSSUL = (bCw-300)/2; AL_CCOneServ.style.height = PopUH-50; //PopUpContext Menu PopUpContextSize(bCw); // Set Height/Widths for Log areas ELogWin.style.height = bCh-(bdH+byM-borderSz)-TitleDivSize; ELogWin.style.width = bCw-byM-10; SCbsy = false; } // Print Discovery var DiscStatWindow = null; function processPrintStatus() { if ( !top.banner.IE55orBetter ) { alert("Print requires IE 5.5/SP1 or greater. Download current, free IE update from Microsoft's web site"); return; } FakeBut.click(); // simulate event to call "savePageCoord(...)" var wprop = "height="+top.banner.bCh+",width="+top.banner.bCw wprop += ",top="+(top.banner.bY-28)+",left="+(top.banner.bX-4)+",scrollbars"; var rName = ""+Math.random(); // use Random number to get unique Window name rName = rName.substring(2,rName.length); DiscStatWindow = window.open("",rName,wprop); if ( DiscStatWindow == null ) { return; } ELogArray.innerHTML = ""; // initailize for ( var i=0; i<LogArray.length; i++ ) { addElementToSelect(ELogArray,LogArray[i]); } var dh = "<html><head><title>MonitorIT - ServerWatch Status Report</title>"; dh += "<link rel='stylesheet' type='text/css' href='css/Rpmstyle.css'></head><body"; dh += " title='Exit to Close Window when Printing is complete'>"; dh += ELogWin.innerHTML; dh += '<script LANGUAGE="JavaScript">ploghdr.border="1"; ploghdr1.width="173"; ploghdr2.width="88"; ploghdr3.width="38"; ploghdr4.width="48"; var LogArrayRecLength = 14; for ( var i=0, j=""; i<ELogArray.length; i+=LogArrayRecLength ) { j = document.all["Graphline"+i].rtot; document.all["Graphline"+i].innerText = j; } window.focus();'; dh += ' </script></body></html>'; DiscStatWindow.document.open(); DiscStatWindow.document.write(dh) DiscStatWindow.document.close(); DiscStatWindow.print(); } /* Initialize the Log and Filter Windows */ function processLogWindow() { /* Format Output to Log Window */ FOps = "<table id='ploghdr' border='0' cellpadding='1' cellSpacing='1' width='100%'><tr>"; FOps += "<td id='ploghdr1' width='175' colspan='1' align='center' title='Sort Log Entries by Computer Name' onclick='processSort(2)' style='cursor:hand; background-color:activeborder' class='optextb'>"; FOps += "Server/Computer Name" + "</td>"; FOps += "<td id='ploghdr2' width='90' colspan='1' align='center' title='Sort Log Entries by IP Address' onclick='processSort(4)' style='cursor:hand; background-color:activeborder' class='optextb'>"; FOps += "IP Address" + "</td>"; FOps += "<td id='ploghdr3' width='52' colspan='1' align='center' title='Sort Log Entries by Service Type' onclick='processSort(1)' style='cursor:hand; background-color:activeborder' class='optextb'>"; FOps += "Type" + "</td>"; FOps += "<td id='ploghdr4' width='50' colspan='1' align='center' title='Sort Log Entries by Time' onclick='processSort(7)' style='cursor:hand; background-color:activeborder' class='optextb'>"; FOps += "Last" + "</td>"; FOps += "<td id='ploghdr5' width='40' colspan='1' align='center' style='background-color:activeborder' class='optextb'>"; FOps += "%Up" + "</td>"; FOps += "<td width='*' colspan='1' align='center' title='Set Service Response Time Graph Scale' onclick='processSetScale()' style='cursor:hand; background-color:activeborder' class='optextb'>"; FOps += "Response Time" + "</td>"; FOps += "</tr></table>"; ELogWin.insertAdjacentHTML("afterBegin",FOps); ELogWinInit = ELogWin.innerHTML; // save for clear log WarningBox.style.display = ""; } /* Process Clear Log button click */ function processClearButton() { processRefresh(); // clear the display GetMRU = true; getComputerInfo(); } function processRefresh() { ELogWin.innerHTML = ELogWinInit; // clear log LogArray.length = 0; LogArrayRecObjectArr.length = 0; ELBgFlg = 0; // reset //ClearButton.className = "BoxButtonD"; // disable button ClearButton.disabled = "disabled"; // disable button //StatusPrintButton.className = "BoxButtonD"; // disable button StatusPrintButton.disabled = "disabled"; // disable button } // Process Server Log Message function procRcv(nLength, szText, sruncts) { var warr= new Array(); var warr1 = new Array(); warr = szText.split(" "); // parse message // if PING, get status, IP Address, and Computer ID if ( warr[4] == "PING" ) { if ( warr[5] == "thread" ) return; // ignore Nstat = ( warr[9] == "successful:" ) ? 0 : 1; Nipaddr = warr[6]; Nid = warr[8]; Ntype = warr[4]; } // check if FTP, SMTP, HTTP, POP, DNS,or USER else if ( warr[4] == "FTP" || warr[4] == "SNMP" || warr[4] == "SMTP" || warr[4] == "HTTP" || warr[4] == "POP" || warr[4] == "DNS" || warr[4] == "USER" || warr[4] == "TELNET" || warr[4] == "L_NOTES") { if ( warr[5] == "thread" ) return; // ignore Nstat = ( warr[13] == "successful:" ) ? 0 : 1; Nipaddr = warr[7]; Nid = warr[9]; Ntype = warr[4]; } // check if AGENT else if ( warr[4] == "AGENT") { if ( warr[5] == "thread" ) return; // ignore Nstat = ( warr[10] == "successful:" ) ? 0 : 1; Nipaddr = warr[7]; Nid = warr[9]; Ntype = warr[4]; } // otherwise ignore else if ( warr[2] == "PING" || warr[2] == "FTP" || warr[2] == "SNMP" || warr[2] == "SMTP" || warr[2] == "HTTP" || warr[2] == "POP" || warr[2] == "DNS" || warr[2] == "USER" || warr[2] == "TELNET" || warr[2] == "L_NOTES" || warr[2] == "AGENT") { if ( warr[3] == "thread" ) return; // ignore Nstat = ( warr[11] == "successful:" ) ? 0 : 1; Nipaddr = warr[5]; Nid = warr[7]; Ntype = warr[2]; } else if ( warr[4] == "SQLCONNECT" ) { if ( warr[5] == "thread" ) return; // ignore Ntype = "SQL"; Nipaddr = ""; if ( warr[11] == "successful:" ) { Nstat = 0; Nid = warr[10]; } else { Nstat = 1; Nid = warr[9]; } } else if ( warr[2] == "SQLCONNECT" ) { Ntype = "SQL"; Nipaddr = ""; Nid = warr[7]; Nstat = ( warr[11] == "successful:" ) ? 0 : 1; } else if ( warr[4] == "ORACLE" ) { if ( warr[5] == "thread" ) return; // ignore Ntype = warr[4]; Nipaddr = ""; if ( warr[12] == "successful:" ) { Nstat = 0; Nid = warr[11]; } else { Nstat = 1; Nid = warr[10]; } } else if ( warr[2] == "ORACLE" ) { Ntype = warr[2]; Nipaddr = ""; Nid = warr[7]; Nstat = ( warr[11] == "successful:" ) ? 0 : 1; }// otherwise ignore else { return; } // convert ' to ` warr1 = szText.split("'"); szText = warr1.join("`"); Rtime = -2; if ( Nstat == 0 ) { // if successful, no 'Reason' message Nreas = ""; // get Response Time data Rtime = szText.lastIndexOf("(T="); if ( Rtime > 0 ) { var Ts = szText.substring(Rtime+3); Rtime = parseInt(Ts,10); } else { Rtime = -1; } } else { // otherwise, parse out the reason for the failure warr1 = szText.split("failed: "); Nreas = warr1[1]; if ( warr[4] == "PING" && warr1.length > 2) { Nreas += "failed: " + warr1[2]; } } Ndt = warr[1].substring(2,10); // Time Nid = ""+parseInt(Nid,10); // Computer ID outputLogEvent(Nstat,Nipaddr,Ntype,Nreas,Nid,Ndt,szText,Rtime,sruncts); } /* Check if Event Passes Filter Test and if so, Output to Log Window */ var LogArrayRecLength = 14; var LogArrayRecObjectArr = new Array(); var LogArray = new Array(); var RespMax = 500; // Graph Scale in ms. var PrevLineObj = null var rescol = ""; function outputLogEvent(Lstat,Lipaddr,Ltype,Lreason,Lid,Ldt,WMsg,Rtm,sruncts) { var pctup = ""; if ( CheckFilterStore(Lid,Ltype) == false ) { // Exit if not in filter return; } ocolor = (Lstat == 0) ? "g" : "r"; // Check if already in the log var AlreadyInLog = false; // preset not in Log var Lindx=0; // preset Log index var Ravg=0, Rcnt=0, Rmax=0, Rup=0, Rdown=0; // initalize running counts if ( LogArray.length > 0 ) { // if Log not empty for ( ; Lindx<LogArray.length; Lindx+=LogArrayRecLength ) { // look for current Computer ID if ( Lid == LogArray[Lindx] && Ltype == LogArray[Lindx+1] ) { if ( Rtm == -1 ) { // if No Time Present (MRU message) & already in log, ignore return; } AlreadyInLog = true; // if match Cname = LogArray[Lindx+2]; // Computer Name Cdesc = LogArray[Lindx+3]; // Computer Description Caddr = LogArray[Lindx+4]; // Computer IP Address Ravg = parseInt(LogArray[Lindx+8],10); // Running Average Rcnt = parseInt(LogArray[Lindx+9],10); // Running Count Rmax = parseInt(LogArray[Lindx+10],10); // Running Max Rup = parseInt(LogArray[Lindx+11],10); // Running Up Rdown = parseInt(LogArray[Lindx+12],10); // Running Down FOps= ""; // initialize break; } } } if (Lstat != 0) { ++Rdown; } else { ++Rup; } if ( AlreadyInLog == false ) { // add new line to log Cname = getCompNameDesc(Lid); // get Name and Descr if ( Cname == "" ) { return; // exit if no name found } if ((ELBgFlg ^= 1) == 0) { FOps = "<div id='Logline"+Lindx+"' style='background-color:white'>"; } else { FOps = "<div id='Logline"+Lindx+"' style='background-color:e8e8e8'>"; } Cdesc = curCompDesc; Caddr = curCompAddr; if ( sruncts != "" ) { var rcarr = new Array(); rcarr = sruncts.split(","); Ravg = parseInt(rcarr[0],10); // Running Average Rcnt = parseInt(rcarr[1],10); // Running Count Rmax = parseInt(rcarr[2],10); // Running Max Rup = parseInt(rcarr[3],10); // Running Up Rdown = parseInt(rcarr[4],10); // Running Down } } Lipaddr = (Lipaddr == "") ? Caddr : Lipaddr; CnameOut = (Cname.length > 40) ? Cname.substring(0,40)+"..." : Cname; // set to Computer Name Ltitle = (Cname.length > 40) ? Cname+" / "+Cdesc : Cdesc; Ltitle += " - Watch/Alert Name = "+getCurrentAlertGrpName(Lid,Ltype); FOps += "<table border='0' cellpadding='1' cellSpacing='1' width='100%'><tr>"; FOps += "<td width='175' colspan='1' style='cursor:hand' class='optext" + ocolor + "'><span title='"+Ltitle+"' id='CmpName"+Lindx+"' >"; FOps += CnameOut + "</span></td>"; FOps += "<td width='90' colspan='1' class='optext" + ocolor + "'>"; FOps += Lipaddr + "</td>"; FOps += "<td width='52' colspan='1' class='optext" + ocolor + "'>"; FOps += Ltype + "</td>"; FOps += "<td width='50' colspan='1' style='cursor:hand' title='"+WMsg+"' class='optext" + ocolor + "'>"; FOps += Ldt + "</td>"; FOps += "<td width='40' colspan='1' style='cursor:hand' title='Up="+Rup+"; Down="+Rdown+"' class='optext" + ocolor + "'>"; if ( Rup == 0 ) { pctup = "0"; } else if ( Rdown == 0 ) { pctup = "100"; } else { pctup = ""+(Math.round((Rup*10000)/(Rup+Rdown)))/100; } FOps += pctup + "</td>"; Tavg = 0; // initialize Response Time percentage if ( Rtm == -2 ) { // if failure Bavg = Aavg = Cavg = "0%"; Davg = "100%"; Rtm = 0; } else if ( Rtm == -1 ) { // if no response time present Cavg = "100%"; Bavg = Aavg = Davg = "0%"; } else { // process Response Time // compute current Response Time percentage Tavg = (Rtm * 100)/RespMax; Tavg = Math.round(Tavg) if ( Tavg < 1 ) { // insure at least 1% Tavg = 1; } // set percentages Cavg = (100-Tavg)+"%"; Bavg = Tavg+"%"; Aavg = Davg = "0%"; // see if new max Rmax = (Rtm > Rmax) ? Rtm : Rmax; } // if current per cent is greater than average if ( Rtm > Ravg && Ravg > 0 ) { // set up bar graph to reflect percentage greater than average CRavg = (Ravg * 100)/RespMax; CRavg = Math.round(CRavg) Bavg = CRavg+"%"; Aavg = (Tavg-CRavg)+"%"; Davg = "0%"; } // Update running average, max, and count if ( Rtm > 0 && sruncts == "" ) { Ravg = ((Ravg * Rcnt) + Rtm)/(++Rcnt); Ravg = Math.round(Ravg); } rtotals = "Last="+Rtm+"ms; Avg="+Ravg+"ms; Max="+Rmax+"ms"; prtot = "Up="+Rup+";Dn="+Rdown+"; "+rtotals; FOps += "<td id='Graphline"+Lindx+"' rtot='"+prtot+"' width='*' colspan='1' class='optext"+ocolor+"'>" FOps += "<table border='0' cellpadding='0' cellSpacing='0' height='12' width='100%'><tr>"; FOps += "<td width='"+Bavg+"' align='center' title='"+rtotals+"' style='cursor:hand; background-color:green'></td>"; FOps += "<td width='"+Aavg+"' align='center' title='"+rtotals+"' style='cursor:hand; background-color:orange'></td>"; FOps += "<td width='"+Davg+"' align='center' title='"+Lreason+"' style='cursor:hand; background-color:red'></td>"; FOps += "<td width='"+Cavg+"' title='"+rtotals+"' style='cursor:hand'></td>"; FOps += "</tr></table>"; FOps += "</td>"; FOps += "</tr></table>"; //ClearButton.className = "BoxButton"; // enable button ClearButton.disabled = ""; // enable button //StatusPrintButton.className = "BoxButton"; // enable button StatusPrintButton.disabled = ""; // enable button if ( AlreadyInLog ) { // if Already In Log update the line var LineObj = null; var ObjIx = Lindx/LogArrayRecLength; if ( ObjIx < LogArrayRecObjectArr.length ) { var LineObj = LogArrayRecObjectArr[ObjIx]; } if ( LineObj == null ) { LineObj = document.all["Logline"+LogArray[Lindx+6]]; LogArrayRecObjectArr[ObjIx] = LineObj; // update log entry object } LineObj.innerHTML = FOps; LogArray[Lindx+4] = Lipaddr; // update saved IP Addr LogArray[Lindx+5] = WMsg; // update saved message LogArray[Lindx+7] = Ldt; // update saved last time LogArray[Lindx+8] = Ravg; // update saved running avergage LogArray[Lindx+9] = Rcnt; // update saved running count LogArray[Lindx+10] = Rmax; // update saved running max LogArray[Lindx+11] = Rup; // update saved running up LogArray[Lindx+12] = Rdown; // update saved running down var udstat = (Lstat != 0) ? "A" : "B"; if (LogArray[Lindx+13] != udstat) { // if status changed if ( STid == null && ServiceDownAtTop.checked ) { STid = setTimeout("GoDoSort()",10000); // Delay before sorting } } LogArray[Lindx+13] = udstat; // save it if ( PrevLineObj != null ) { PrevLineObj.style.backgroundColor = rescol; } if ( TrackLastEnabled.checked ) { rescol = LineObj.style.backgroundColor; LineObj.style.backgroundColor = "scrollbar"; PrevLineObj = LineObj; } else { PrevLineObj = null; } } else { // otherwise, add New FOps += "</div>"; ELogText.insertAdjacentHTML("afterBegin",FOps); // save info in Store Lindex = LogArray.length LogArray[Lindex] = Lid; LogArray[Lindex+1] = Ltype; LogArray[Lindex+2] = Cname; // Computer Name LogArray[Lindex+3] = Cdesc; // Computer Description LogArray[Lindex+4] = Lipaddr; LogArray[Lindex+5] = WMsg; LogArray[Lindex+6] = Lindx; LogArray[Lindex+7] = Ldt; LogArray[Lindex+8] = Ravg; LogArray[Lindex+9] = Rcnt; LogArray[Lindex+10] = Rmax; LogArray[Lindex+11] = Rup; LogArray[Lindex+12] = Rdown; LogArray[Lindx+13] = (Lstat != 0) ? "A" : "B"; // save up or down status if ( STid == null && MRUDataArr.length == 0 && sruncts == "" ) { STid = setTimeout("GoDoSort()",10000); // Delay before sorting } } } // Process Header Column Click and Sort Accordingly var LogSortCode = 0; function GoDoSort() { doSort(); // go process the Sort STid = null; // reset t/o } function processSort(sortcode) { LogSortCode = sortcode; // set sort Code doSort(); // save sort code in the Registry RpmCC_VA.RegSetKey(top.banner.ServerID+"ServerWatchSortCode",""+sortcode); } function doSort() { var SArray = new Array(); var warr = new Array(); var sortcode = LogSortCode; var udsort = "", runcounts = ""; // create an array to sort on the specified parameter for ( var i=0, j=0; i<LogArray.length; i+=LogArrayRecLength, j++) { runcounts = LogArray[i+8]+","+LogArray[i+9]+","+LogArray[i+10]+","+LogArray[i+11]+","+LogArray[i+12]; udsort = ( ServiceDownAtTop.checked ) ? LogArray[i+13] : ""; SArray[j] = udsort+"???"+LogArray[i+sortcode].toLowerCase()+"???"+LogArray[i+5]+"???"+runcounts; } ELogWin.innerHTML = ELogWinInit; // clear log LogArrayRecObjectArr.length = 0; LogArray.length = 0; ELBgFlg = 0; // reset SArray.sort(); // now sort it // Now go reprocess and display for ( var i=SArray.length-1; i>=0; i-- ) { warr = SArray[i].split("???"); // parse out the orig message procRcv(warr[2].length, warr[2], warr[3]); // output to Log } } // Add Computer to Store if Not Already var CompRecLength = 4; function processCompAddToStore(CNme,CDesc,Cid,Addr) { for ( var i=0; i<AC_CompStoreArr.length; i+=CompRecLength ) { if ( Cid == AC_CompStoreArr[i] ) { // if in Store, update it AC_CompStoreArr[i+1] = CNme; // update name AC_CompStoreArr[i+2] = CDesc; // update description AC_CompStoreArr[i+3] = Addr; // update description return; } } // Not in Store, Add now var j = AC_CompStoreArr.length; AC_CompStoreArr[j] = Cid; AC_CompStoreArr[j+1] = CNme; AC_CompStoreArr[j+2] = CDesc; AC_CompStoreArr[j+3] = Addr; } var curCompDesc = ""; var curCompAddr = ""; function getCompNameDesc(CompID) { for ( var i=0; i<AC_CompStoreArr.length; i+=CompRecLength ) { if ( CompID == AC_CompStoreArr[i] ) { // if in Store curCompDesc = AC_CompStoreArr[i+2]; curCompAddr = AC_CompStoreArr[i+3] return AC_CompStoreArr[i+1]; } } return ""; } // Check if Computer/Service Type is in the Filter function CheckFilterStore(LCid,LStype) { // if Filter empty,accept everything if ( AC_FilterStoreArr.length == 0 ) { return true; } for ( var i=0; i<AC_FilterStoreArr.length; i+=FilterRecLength ) { // if in Store if ( LCid == AC_FilterStoreArr[i] && LStype == AC_FilterStoreArr[i+1] ) { return true; } } return false; } function RemoveFromFilterStore(RCid,RStype) { for ( var i=0; i<AC_FilterStoreArr.length; i+=FilterRecLength ) { if ( RCid == AC_FilterStoreArr[i] && RStype == AC_FilterStoreArr[i+1] ) { // if found for (var j=i+FilterRecLength; j < AC_FilterStoreArr.length; ++i, ++j) { AC_FilterStoreArr[i] = AC_FilterStoreArr[j]; } AC_FilterStoreArr.length -= FilterRecLength; return; } } } var FilterRecLength = 2; function AddToFilterStore(ACid,AStype) { if ( CheckFilterStore(ACid,AStype) == true && AC_FilterStoreArr.length != 0) { // ignore if already in Filter return; } var i = AC_FilterStoreArr.length AC_FilterStoreArr[i] = ACid; AC_FilterStoreArr[i+1] = AStype; } // Set Graph Scale function processSetScale() { var cscale = (RespMax >= 1000) ? (RespMax/1000)+19 : (RespMax/50); SS_Scale.options[cscale-1].selected = "selected"; // Select current PopUpSS.style.display = ""; // enable Pop-Up } function processDoneScale() { PopUpSS.style.display = "none"; var cscale = (SS_Scale.selectedIndex+1); // set new scale max RespMax = (cscale < 20) ? (cscale * 50) : ((cscale-19) * 1000); RpmCC_VA.RegSetKey(top.banner.ServerID+"ServerWatchScaleMax",RespMax+" ms."); top.Rstatus.Pstat("Response Time Graph Scale Max = "+RespMax+" ms."); } // Process Specify and Done Button Click function processSpecifyButton() { if ( ServExpandedCount > 0 ) { SetButtonState(bSelC,"0"); SetButtonState(bUselC,"0"); } else { // otherwise disable the buttons SetButtonState(bSelC,"1"); SetButtonState(bUselC,"1"); } PopUpDiv.style.display = ""; // enable Pop-Up SpecificationsMade = false; // reset Flag processAlLookup(); // initaite read for Alert Groups and Services } function processDoneButton() { PopUpDiv.style.display = "none"; if ( SpecificationsMade ) { // if any change made // save Filter and Computer Store and refresh Log RpmCC_VA.RegSetKey(top.banner.ServerID+"ServerWatchFilterArray",AC_FilterStoreArr.join("~")); processRefresh(); WarningBox.style.display = ""; Tid = setTimeout("finishDone()",50); // Delay } top.Rstatus.Pstat("Done"); } /* Get MRU Log Messages for ServerWatch */ function finishDone() { Tid = null; // reset RpmCC_VA.GetServicesLogMRU(); // get most recent Server log ServerWatch messages //SpecifyButton.className = "BoxButton"; // enable button SpecifyButton.disabled = ""; // enable button top.banner.processStopCommX(); } // Process to Toggle the Hide and Show of the Banner & Menu Frames var hideToggle = 0; var TitleDivSize = 98; function processBannerMenu() { if ( hideToggle == 0 ) { top.BannerMenuHide(); hideToggle = 1; ServerWatchTitleDiv.style.display = "none"; TitleDivSize = 54; } else { top.BannerMenuShow(); hideToggle = 0; ServerWatchTitleDiv.style.display = ""; TitleDivSize = 98; } processSizeChange(); } function PopUpContextOpen() { } function PopUpContextClose() { } var MRUDataArr = new Array(); var MRUDataArrIndex = 0; function processLogMRUData() { for ( var i=0; i < 10 && MRUDataArrIndex < MRUDataArr.length; i++, MRUDataArrIndex++ ) { procRcv(MRUDataArr[ MRUDataArrIndex ].length, MRUDataArr[ MRUDataArrIndex ], ""); } if ( MRUDataArrIndex < MRUDataArr.length ) { LTid = setTimeout("processLogMRUData()",100); // Delay 100 msecs then continue } else { MRUDataArr.length = 0; if ( STid == null ) { STid = setTimeout("GoDoSort()",1000); // Delay before sorting } } } //--> </script> <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script> <script LANGUAGE="JavaScript" src="js/ButtonFunc.js"></script> <script LANGUAGE="JavaScript" src="js/ServerWatchFunc.js"></script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="Connected()"> <!-- processConnectConfirmed(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="DBChanged(cdata)"> <!-- var warr = new Array(); warr = cdata.split("~"); // parse the event data // Ignore if Server Table change if ( warr[0] == "4" ) return; // ignore top.Rstatus.StatDB.style.display = ""; if ( CTid == null ) { CTid = setTimeout("processDBChanged()",30000); // Delay 30 secs then process } //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="Disconnected()"> <!-- top.Rstatus.Pstat("Disconnected",true); if ( Tid != null ) { clearTimeout(Tid); // stop timeout routine } Tid = setTimeout("processReconnect()",10000); // Delay 10 secs then try reconnnect //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ServicesLogMRUData(dStrg)"> <!-- WarningBox.style.display = "none"; WarningBox1.style.display = "none"; MRUDataArr = dStrg.split("???"); // parse message MRUDataArrIndex = 0; processLogMRUData(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ServicesLogMRUOpComplete()"> <!-- WarningBox.style.display = "none"; WarningBox1.style.display = ""; top.Rstatus.Pstat("No status messages available",true); top.banner.processStopCommX(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ServicesLogMRUOpError()"> <!-- WarningBox.style.display = "none"; WarningBox1.style.display = ""; top.Rstatus.Pstat("Error attempting to get most recent status messages",true); top.banner.processStopCommX(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ComputerLookupRecord(Cid,Gid,SrvID,Nme,Desc,Pswd,OSVer,Addr,Port)"> <!-- processCompAddToStore(Nme,Desc,Cid,Addr); if (ALupMode == "SrvComputerLookupEdit") { processEditSrvComputer(Nme,Desc,Cid); } //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="AlertGroupOpComplete()"> <!-- processAlertOpComplete(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ComputerOpComplete()"> <!-- if (ALupMode == "SrvComputerLookupEdit") { processEditSrvComputerComplete(); } else { if ( ALupMode == "InitComputerLookup" ) { if ( GetMRU == true ) { RpmCC_VA.GetServicesLogMRU(); // get most recent Server log ServerWatch messages } RpmCC_VA.AllowNewMessages(); // enable new Server Log messages to be sent } ALupMode= ""; top.Rstatus.Pstat("Request Completed"); } //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="AlertGroupOpError()"> <!-- processAlertOpError(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ComputerOpError()"> <!-- processComputerOpError(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ReceiveText(nLength, szText)"> <!-- procRcv(nLength, szText, ""); //--> </script> <script FOR="RpmCC_VA" EVENT="ServicesRecord(SRVstrg)"> <!-- processServicesRecord(SRVstrg); //--> </script> <script FOR="RpmCC_VA" EVENT="ServicesOpComplete()"> <!-- processServicesOpComplete(); //--> </script> <script FOR="RpmCC_VA" EVENT="ServicesOpError()"> <!-- processServicesOpError(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="AlertGroupLookupRecordPart1(AlID, AlName, AlDesc, AlThresh, AlOver, AlEveryTime, AlDur, AlSched, AlSDT, AlEDT, AlArrayIDs)"> <!-- AlertLupRec(AlID, AlName, AlDesc); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="StartCommunication()"> <!-- //top.banner.processStartComm(); //--> </script> <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="StopCommunication()"> <!-- top.banner.processStopCommX(); //--> </script> <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script> <object ID="RpmCC_VA" NAME="RpmCC_VA" WIDTH="14" HEIGHT="1" style="display:none" CLASSID="CLSID:D88C2358-FC83-11D1-BF49-00104B2D6F80" CODEBASE="controls/RPMComm.cab#version=5,2,0,0"> <param name="_Version" value="65536"> <param name="_ExtentX" value="2646"> <param name="_ExtentY" value="1341"> <param name="_StockProps" value="0"> </object> <!-- Invisible Object to Support Simulated Click Event --> <button id="FakeBut" style="display:none" onclick="top.banner.savePageCoord(event,document.body,'ServerWatch')"> </button> <!-- Define Images used in dynamic HTML generation to force loading and caching now --> <div style="display:none"> <img src="images/sMicroscope.gif"><img src="images/White.gif"><img src="images/Computer.gif"> <img src="images/Lplus.gif"><img src="images/I.gif"><img src="images/Tplus.gif"> <img src="images/L.gif"><img src="images/topopen.gif"><img src="images/T.gif"> <img src="images/sAdminServers.gif"> </div> <center> <div id="VA_MainBox" class="VAMainBox" style="display:none"> <!-- PopUp to Prompt for Services/Computers To Monitor --> <div id="PopUpDiv" class="PopUpSSBox" style="display:none; overflow : none; left:150; top:150; "> <center> <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" > <tr><td height="23" style="font-weight:800; font-size:11pt; background-color:graytext; color:captiontext" align="center">Specify Status Log Display Filter</td></tr> <tr><td height="5" class="inputlabel" align="right"></td></tr> <tr><td width="100%" class="optext" align="center"><div id="AL_CCOneServ" class="PopUpBox"></div></td></tr> <tr><td height="3" class="inputlabel" align="right"></td></tr> <tr align="center"><td width ="100%"><table border="1" cellspacing="1" cellpadding="1" height="40" width="100%"><tr><td align="center"><button onclick="processSelect('0')" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" style="width:80px; height:28px" id="bSelC" disabled><img src="images/selectall.gif" align="absmiddle" height="15" width="14">Select All</button>  <button onclick="processSelect('1')" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" style="width:93px; height:28px" id="bUselC" disabled><img src="images/unselectall.gif" align="absmiddle" height="15" width="14">Unselect All</button>  <button id="DoneButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="" style="width:80px; height:28px" onClick="processDoneButton()"><img src="images/CloseImg.gif" align="absmiddle" height="14" width="15"> Close  </button> </td></tr></table></td></tr> </table> </center> </div> <!-- End of Pop-Up ----------------------------------------------> <!-- PopUp to Prompt for Set Graph Scale --> <div id="PopUpSS" class="PopUpSSBox" style="display:none; left:150; top:150; width:300"> <center><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" > <tr><td height="23" style="font-weight:800; font-size:11pt; background-color:graytext; color:captiontext" colspan="2" align="center">Set Response Time Graph Scale Max</td></tr> <tr><td colspan="2" height="10" class="inputlabel" align="right"></td></tr> <tr><td height="10" width="100%" class="optext" align="center"><select SIZE="1" NAME="SS_Scale"></select></td></tr> <tr><td colspan="2" height="30" class="inputlabel" align="right"></td></tr> </table> <table width="100%" align="center" border="0" cellspacing="1" cellpadding="2" > <tr><td align="center" width ="100%"><button id="CloseSSButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Close" style="width:75px; height:29px" onClick="processDoneScale()" ><img src="images/CloseImg.gif" align="absmiddle" height="14" width="15">Close </button> </td></tr> <tr><td height="5" class="inputlabel" align="center"> </td></tr> </table></center> </div> <!-- End of Pop-Up ----------------------------------------------> <div id="ServerWatchTitleDiv"><table border="1" borderColor="activeborder" align="left"> <tr ><td borderColorDark="graytext" borderColorLight="white" height="25" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/sMicroscope.gif" align="absmiddle" height="16" width="16"> Server Watch Display </td></tr> </table> <BR CLEAR=ALL><HR align="left"></div> <center class="inputlabel">Server Status Log</center> <div class="EventLog" ID="ELogWin" style="width:98%" align="center" > <center><div style="display:none; width:100%" id="WarningBox" align="center"><table border="0" cellpadding="0" cellspacing="2"> <tr> <td width="43"><img src="images/HourGlass.gif" width="32" height="32" alt="Please Wait!" align="bottom" border="0"></td> <td width="*" style="font-family:Arial; font-size:10pt; font-weight:bold; color:infotext">Please Wait For Most Recent Status Messages!</td> </tr> </table> </div> <div style="display:none; width:100%" id="WarningBox1" align="center"><table border="0" cellpadding="0" cellspacing="2"> <tr> <td width="*" style="font-family:Arial; font-size:10pt; font-weight:bold; color:red">There Are No Most Recent Status Messages Available!</td> </tr> </table> </div></center> <span id="ELogText"></span><select id="ELogArray" style="display:none"></select></div> <div style="height:0px; width:100%" align="center"> <table border="1" cellspacing="1" cellpadding="1" height="40" width="100%"> <tr> <td width="25%" align="left" class="inputlabel"><span title="Display Down Services at Top"><INPUT TYPE="checkbox" NAME="ServiceDownAtTop" id="ServiceDownAtTop" class="inputlabel" onclick="processServiceDownAtTopClick()" CHECKED>Failures At Top</span></td> <td align="center" width ="50%"><button id="ClearButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Clear the Event Log" style="width:85px; height:29px" onClick="processClearButton()" disabled><img src="images/unselectall.gif" align="absmiddle" height="15" width="14"> Clear Log</button> <button id="SpecifyButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Specify Servers/Services to Monitor" style="width:115px; height:29px" onClick="processSpecifyButton()" > <img src="images/ConfigImg.gif" align="absmiddle" height="18" width="17">Configure Filter</button> <button id="StatusPrintButton" title="Print ServerWatch Status Log" onclick="if (this.bdis == '0') processPrintStatus();" bdis="0" style="width:85px; height:29px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" DISABLED><img src="images/Printer.gif" align="absmiddle" height="15" width="17"> Print</button></td> <td width="25%" class="inputlabel" align="right"><span title="Highlight the last entry updated in the ServerWatch Display"><INPUT TYPE="checkbox" NAME="TrackLastEnabled" id="TrackLastEnabled" class="inputlabel" onclick="processTrackLastClick()" CHECKED>Track Last</span> <button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames" style="cursor:hand"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td></tr> </table> </div> </center></div> </center> </body> </html>